# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=appstream-glib
pkgver=0.8.2
pkgrel=2
pkgdesc="Objects and methods for reading and writing AppStream metadata"
url="https://people.freedesktop.org/~hughsient/appstream-glib/"
arch=(x86_64)
license=(LGPL)
depends=(
  curl
  gtk3
  libstemmer
  libyaml
  pacman
)
makedepends=(
  git
  gobject-introspection
  gperf
  gtk-doc
  meson
)
provides=(
  appdata-tools
  libappstream-glib.so
)
conflicts=(appdata-tools)
replaces=(appdata-tools)
_commit=02c8ad3b66075d9b2c9094dff816cd44839a4b45  # tags/appstream_glib_0_8_2^0
source=("git+https://github.com/hughsie/appstream-glib#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^appstream_glib_//;s/_/./g;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  local meson_options=(
    -D alpm=true
    -D gtk-doc=true
    -D rpm=false
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
